/**
 * typescript: js超集
 *
 */
function add(a: number, b: number): number {
    return a + b;
}

const sub = (a: number, b: number): number => {
    return a + b
}

const apply = (a: number, b: number, cb: Function): number => {
    return cb(a,b)
}

let a = 20, b = 3;
const result = apply(a, b, add)
console.log('result = ', result)

function sum(a:number , b:number) :number{
    return a + b
}

// 类型声明
const value:number = sum(123,
    // "456"
    456
)
console.log(value)